package ch.rheintalconnection.sysventory.application;

import java.net.InetAddress;
import java.sql.Timestamp;
import ch.rheintalconnection.sysventory.domain.Client;

import com.vaadin.ui.Button;

@SuppressWarnings("rawtypes")

public enum PCAttribute {
	Client,
	ScanDate,Programs, Printers,
	OSName, OSVersion, OSTechnology,
	CPUDesc, CPUFamily, CPUCores, CPUClockrate,
	PCName, PCRAM, PCType, PCHD,
	NICIP, NICMacAddress, NICDesc, NICGateway, NICDHCP, NICSubnet;
	
	public String getPresentationName(){
		
		String sPresentationName = "";
		
		switch (this) {
		case Client:
		sPresentationName = "Client";
			break;
		case ScanDate:
			sPresentationName = "Scandatum";
			break;
		case Programs:
			sPresentationName = "Programme";
			break;
		case Printers:
			sPresentationName = "Drucker";
			break;	
		case OSName:
			sPresentationName = "OS-Name";
			break;
		case OSVersion:
			sPresentationName = "OS-Version";
			break;
		case OSTechnology:
			sPresentationName = "OS-Technologie";
			break;
		case CPUDesc:
			sPresentationName = "CPU-Beschreibung";
			break;
		case CPUFamily:
			sPresentationName = "Prozessorfamilie";
			break;
		case CPUCores:
			sPresentationName = "Anzahl Kerne";
			break;
		case CPUClockrate:
			sPresentationName = "Prozessortaktrate";
			break;
		case PCName:
			sPresentationName = "Computername";
			break;
		case PCRAM:
			sPresentationName = "RAM";
			break;
		case PCType:
			sPresentationName = "Computertyp";
			break;
		case PCHD:
			sPresentationName = "HD-Grösse & Auslastung";
			break;
		case NICIP:
			sPresentationName = "NIC IP-Adresse";
			break;
		case NICMacAddress:
			sPresentationName = "MAC-Adresse";
			break;
		case NICDesc:
			sPresentationName = "NIC Beschreibung";
			break;
		case NICGateway:
			sPresentationName = "Standard Gateway";
			break;
		case NICDHCP:
			sPresentationName = "DHCP";
			break;
		case NICSubnet:
			sPresentationName = "Subnet";
			break;

		default:
			throw new IllegalArgumentException();
		}
		
		
		return sPresentationName;
		
	}
	

	public Class getType() {
		
		Class clazz = null;
		
		switch (this) {
		case Client:
			clazz = Client.class;
			break;
		case ScanDate:
			clazz = Timestamp.class;
			break;
		case Programs:
			clazz = Button.class;
			break;
		case Printers:
			clazz = Button.class;
			break;	
		case OSName:
			clazz = String.class;
			break;
		case OSVersion:
			clazz = String.class;
			break;
		case OSTechnology:
			clazz = String.class;
			break;
		case CPUDesc:
			clazz = String.class;
			break;
		case CPUFamily:
			clazz = String.class;
			break;
		case CPUCores:
			clazz = Integer.class;
			break;
		case CPUClockrate:
			clazz = String.class;
			break;
		case PCName:
			clazz = String.class;
			break;
		case PCRAM:
			clazz = Long.class;
			break;
		case PCType:
			clazz = String.class;
			break;
		case PCHD:
			clazz = String.class;
			break;
		case NICIP:
			clazz = InetAddress.class;
			break;
		case NICMacAddress:
			clazz = String.class;
			break;
		case NICDesc:
			clazz = String.class;
			break;
		case NICGateway:
			clazz = InetAddress.class;
			break;
		case NICDHCP:
			clazz = InetAddress.class;
			break;
		case NICSubnet:
			clazz = InetAddress.class;
			break;

		default:
			throw new IllegalArgumentException();
		}
		
		
		return clazz;
		
	}
	
	@Override
	public String toString(){
		return this.getPresentationName();
		
	}
	
}